<template>
    <view class="top-20 bottom-20 navsWrap flex">
        <block v-for="(navItem, index) in navs" :key="index">
            <view class="navItem text-center font13" @click="navRoute(navItem)">
                <image class="navImage bottom-5" :src="navItem.image" mode="heightFix"></image>
                <view>{{navItem.name}}</view>
            </view>
        </block>
    </view>
</template>

<script>
	export default {
        data() {
        	return {
                navs: [{
                   name: '户型图',
                   image: 'https://image.srea.org.cn/xcx/icon/icon-product-detail-menu-house-type.png',
                   path: '/pages/product/house-type/list/page',
                   type: 'houseType'
                },{
                   name: '楼盘动态',
                   image: 'https://image.srea.org.cn/xcx/icon/icon-product-detail-menu-house-dynamic.png',
                   path: '/pages/product/dynamic/index',
                   type: 'dynamic'
                },{
                   name: '一房一价',
                   image: 'https://image.srea.org.cn/xcx/icon/icon-product-detail-menu-yi-fang-yi-jia.png',
                   path: '/pages/product/one-house-one-price/one-house-one-price-image',
                   type: 'yiFangYiJia'
                },{
                   name: '周边配套',
                   image: 'https://image.srea.org.cn/xcx/icon/icon-product-detail-menu-around.png',
                   path: '/pages/product/map/map-nearby',
                   type: 'around'
                },{
                   name: '楼盘图片',
                   image: 'https://image.srea.org.cn/xcx/icon/icon-product-detail-menu-album.png',
                   path: '/pages/product/album/index',
                   type: 'images'
                }]
        	}
        },
        props: {
            product: {
                type: Object,
                default: () => ({})
            },
            kaiId: {
                type: [String, Number],
                default: ''
            }
        },
		methods:{
            //点击Navs
            navRoute(info){
                uni.navigateTo({
                	url: `${info.path}?pageType=${info.type}&productId=${this.product.id}&kaiId=${this.kaiId}&title=${this.product.title}&lat=${this.product.lat}&lng=${this.product.lng}`
                })
            }
		}
	}
</script>

<style scoped lang="scss">
    .navsWrap{
        justify-content: space-between;
        .navItem{
            width: 20%;
            display: inline-block;
            .navImage{
                height: 46rpx;
            }
        }
    }
</style>
